cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Connection getting closed on receiving 401 from server during POST

From: Vivek S <svivekchellam_at_gmail.com>
Date: Tue, 15 Jul 2014 10:01:12 +0530

I felt so. So using a dirty fix for now by not closing the connection
for 401, something like,

lib/http.c,
@@ -3084,6 +3084,10 @@
                * connection for closure after we've read the entire response.
                */
               if(!k->upload_done) {
+ if(k->httpcode == 401) {
+ infof(data, "HTTP error before end of send, no stop\n");
+ }
+ else {
                 infof(data, "HTTP error before end of send, stop sending\n");
                 conn->bits.close = TRUE; /* close after this */
                 k->upload_done = TRUE;
@@ -3091,6 +3095,7 @@
                 if(data->state.expect100header)
                   k->exp100 = EXP100_FAILED;
               }
+ }
               break;

             default: /* default label present to avoid compiler warnings */

I guess its a bad way of doing it, but this is what am using and works
fine till now. I would appreciate and welcome any attempt in making
this better..

- Vivek S

On Mon, Jul 14, 2014 at 11:13 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> I get it. You basically want a new option that tells libcurl to pretend NTLM
> is in use - more or less - so that it maintains the connection with a higher
> precedence than it does now. I can't see that we currently have any option
> that makes libcurl do this...
>
> --
>
> / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-07-15