Fossil SCM
Fix the establish_proxy_tunnel() routine so that it works even if CRs are omitted from the protocol by the proxy.
Commit
e8d328cbd320e2417606a99a5ed6f0d8a3f67dd06d115fcf14a86df1b1fb4a6f
Parent
521da5cd31fa47d…
1 file changed
+4
-6
+4
-6
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -403,16 +403,14 @@ | ||
| 403 | 403 | blob_append(&reply, buf, len); |
| 404 | 404 | |
| 405 | 405 | bbuf = blob_buffer(&reply); |
| 406 | 406 | len = blob_size(&reply); |
| 407 | 407 | while(end < len) { |
| 408 | - if(bbuf[end] == '\r') { | |
| 409 | - if(len - end < 4) { | |
| 410 | - /* need more data */ | |
| 411 | - break; | |
| 412 | - } | |
| 413 | - if(memcmp(&bbuf[end], "\r\n\r\n", 4) == 0) { | |
| 408 | + if( bbuf[end]=='\n' ) { | |
| 409 | + if( (end+1<len && bbuf[end+1]=='\n') | |
| 410 | + || (end+2<len && bbuf[end+1]=='\r' && bbuf[end+1]=='\n') | |
| 411 | + ){ | |
| 414 | 412 | done = 1; |
| 415 | 413 | break; |
| 416 | 414 | } |
| 417 | 415 | } |
| 418 | 416 | end++; |
| 419 | 417 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -403,16 +403,14 @@ | |
| 403 | blob_append(&reply, buf, len); |
| 404 | |
| 405 | bbuf = blob_buffer(&reply); |
| 406 | len = blob_size(&reply); |
| 407 | while(end < len) { |
| 408 | if(bbuf[end] == '\r') { |
| 409 | if(len - end < 4) { |
| 410 | /* need more data */ |
| 411 | break; |
| 412 | } |
| 413 | if(memcmp(&bbuf[end], "\r\n\r\n", 4) == 0) { |
| 414 | done = 1; |
| 415 | break; |
| 416 | } |
| 417 | } |
| 418 | end++; |
| 419 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -403,16 +403,14 @@ | |
| 403 | blob_append(&reply, buf, len); |
| 404 | |
| 405 | bbuf = blob_buffer(&reply); |
| 406 | len = blob_size(&reply); |
| 407 | while(end < len) { |
| 408 | if( bbuf[end]=='\n' ) { |
| 409 | if( (end+1<len && bbuf[end+1]=='\n') |
| 410 | || (end+2<len && bbuf[end+1]=='\r' && bbuf[end+1]=='\n') |
| 411 | ){ |
| 412 | done = 1; |
| 413 | break; |
| 414 | } |
| 415 | } |
| 416 | end++; |
| 417 |