Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
42280e95
Commit
42280e95
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
removed URL size restrictions
parent
b2ad1f68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/dict.c
+1
-1
1 addition, 1 deletion
lib/dict.c
lib/http.c
+1
-1
1 addition, 1 deletion
lib/http.c
lib/url.c
+21
-3
21 additions, 3 deletions
lib/url.c
lib/urldata.h
+1
-1
1 addition, 1 deletion
lib/urldata.h
with
24 additions
and
6 deletions
lib/dict.c
+
1
−
1
View file @
42280e95
...
...
@@ -233,7 +233,7 @@ CURLcode dict(struct connectdata *conn)
int
i
;
ppath
++
;
for
(
i
=
0
;
(
i
<
URL_MAX_LENGTH
)
&&
(
ppath
[
i
]
)
;
i
++
)
{
for
(
i
=
0
;
ppath
[
i
];
i
++
)
{
if
(
ppath
[
i
]
==
':'
)
ppath
[
i
]
=
' '
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/http.c
+
1
−
1
View file @
42280e95
...
...
@@ -327,7 +327,7 @@ CURLcode http(struct connectdata *conn)
}
if
((
data
->
bits
.
httpproxy
)
&&
!
(
conn
->
protocol
&
PROT_HTTPS
))
{
/* The path sent to the proxy is in fact the entire URL */
strncpy
(
ppath
,
data
->
url
,
URL_MAX_LENGTH
-
1
)
;
ppath
=
data
->
url
;
}
if
(
data
->
bits
.
http_formpost
)
{
/* we must build the whole darned post sequence first, so that we have
...
...
This diff is collapsed.
Click to expand it.
lib/url.c
+
21
−
3
View file @
42280e95
...
...
@@ -677,6 +677,9 @@ CURLcode curl_disconnect(CURLconnect *c_connect)
if
(
conn
->
hostent_buf
)
/* host name info */
free
(
conn
->
hostent_buf
);
if
(
conn
->
path
)
/* the URL path part */
free
(
conn
->
path
);
free
(
conn
);
/* free the connection oriented data */
/* clean up the sockets and SSL stuff from the previous "round" */
...
...
@@ -696,6 +699,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
#ifdef HAVE_SIGACTION
struct
sigaction
sigact
;
#endif
int
urllen
;
if
(
!
data
||
(
data
->
handle
!=
STRUCT_OPEN
))
return
CURLE_BAD_FUNCTION_ARGUMENT
;
/* TBD: make error codes */
...
...
@@ -734,13 +738,25 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
#endif
/* We need to allocate memory to store the path in. We get the size of the
full URL to be sure, and we need to make it at least 256 bytes since
other parts of the code will rely on this fact */
#define LEAST_PATH_ALLOC 256
urllen
=
strlen
(
data
->
url
);
if
(
urllen
<
LEAST_PATH_ALLOC
)
urllen
=
LEAST_PATH_ALLOC
;
conn
->
path
=
(
char
*
)
malloc
(
urllen
);
if
(
NULL
==
conn
->
path
)
return
CURLE_OUT_OF_MEMORY
;
/* really bad error */
/* Parse <url> */
/* We need to parse the url, even when using the proxy, because
* we will need the hostname and port in case we are trying
* to SSL connect through the proxy -- and we don't know if we
* will need to use SSL until we parse the url ...
*/
if
((
2
==
sscanf
(
data
->
url
,
"%64[^:]://%
"
URL_MAX_LENGTH_TXT
"
[^
\n
]"
,
if
((
2
==
sscanf
(
data
->
url
,
"%64[^:]://%[^
\n
]"
,
conn
->
proto
,
conn
->
path
))
&&
strequal
(
conn
->
proto
,
"file"
))
{
/* we deal with file://<host>/<path> differently since it
...
...
@@ -760,11 +776,11 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
strcpy
(
conn
->
path
,
"/"
);
if
(
2
>
sscanf
(
data
->
url
,
"%64[^
\n
:]://%256[^
\n
/]%
"
URL_MAX_LENGTH_TXT
"
[^
\n
]"
,
"%64[^
\n
:]://%256[^
\n
/]%[^
\n
]"
,
conn
->
proto
,
conn
->
gname
,
conn
->
path
))
{
/* badly formatted, let's try the browser-style _without_ 'http://' */
if
((
1
>
sscanf
(
data
->
url
,
"%256[^
\n
/]%
"
URL_MAX_LENGTH_TXT
"
[^
\n
]"
,
if
((
1
>
sscanf
(
data
->
url
,
"%256[^
\n
/]%[^
\n
]"
,
conn
->
gname
,
conn
->
path
))
)
{
failf
(
data
,
"<url> malformed"
);
return
CURLE_URL_MALFORMAT
;
...
...
@@ -1548,6 +1564,8 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
in the connectdata struct, free those here */
conn
=
(
struct
connectdata
*
)
*
in_connect
;
if
(
conn
)
{
if
(
conn
->
path
)
free
(
conn
->
path
);
if
(
conn
->
hostent_buf
)
free
(
conn
->
hostent_buf
);
free
(
conn
);
...
...
This diff is collapsed.
Click to expand it.
lib/urldata.h
+
1
−
1
View file @
42280e95
...
...
@@ -175,7 +175,7 @@ struct connectdata {
char
proto
[
64
];
char
gname
[
256
];
char
*
name
;
char
path
[
URL_MAX_LENGTH
];
char
*
path
;
/* formerly staticly this size:
URL_MAX_LENGTH
*/
char
*
ppath
;
long
bytecount
;
struct
timeval
now
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment