@@ -264,14 +264,14 @@ namespace ix
264
264
if (!success)
265
265
{
266
266
auto errorCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::CannotConnect;
267
- std::stringstream ss ;
268
- ss << " Cannot connect to url: " << url << " / error : " << errMsg;
267
+ std::stringstream errSs ;
268
+ errSs << " Cannot connect to url: " << url << " / error : " << errMsg;
269
269
return std::make_shared<HttpResponse>(code,
270
270
description,
271
271
errorCode,
272
272
headers,
273
273
payload,
274
- ss .str (),
274
+ errSs .str (),
275
275
uploadSize,
276
276
downloadSize);
277
277
}
@@ -281,27 +281,27 @@ namespace ix
281
281
282
282
if (args->verbose )
283
283
{
284
- std::stringstream ss ;
285
- ss << " Sending " << verb << " request "
284
+ std::stringstream verboseSs ;
285
+ verboseSs << " Sending " << verb << " request "
286
286
<< " to " << host << " :" << port << std::endl
287
287
<< " request size: " << req.size () << " bytes" << std::endl
288
288
<< " =============" << std::endl
289
289
<< req << " =============" << std::endl
290
290
<< std::endl;
291
291
292
- log (ss .str (), args);
292
+ log (verboseSs .str (), args);
293
293
}
294
294
295
295
if (!_socket->writeBytes (req, isCancellationRequested))
296
296
{
297
297
auto errorCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::SendError;
298
- std::string errorMsg (" Cannot send request" );
298
+ std::string msg (" Cannot send request" );
299
299
return std::make_shared<HttpResponse>(code,
300
300
description,
301
301
errorCode,
302
302
headers,
303
303
payload,
304
- errorMsg ,
304
+ msg ,
305
305
uploadSize,
306
306
downloadSize);
307
307
}
@@ -315,33 +315,33 @@ namespace ix
315
315
if (!lineValid)
316
316
{
317
317
auto errorCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::CannotReadStatusLine;
318
- std::string errorMsg (" Cannot retrieve status line" );
318
+ std::string msg (" Cannot retrieve status line" );
319
319
return std::make_shared<HttpResponse>(code,
320
320
description,
321
321
errorCode,
322
322
headers,
323
323
payload,
324
- errorMsg ,
324
+ msg ,
325
325
uploadSize,
326
326
downloadSize);
327
327
}
328
328
329
329
if (args->verbose )
330
330
{
331
- std::stringstream ss ;
332
- ss << " Status line " << line;
333
- log (ss .str (), args);
331
+ std::stringstream verboseSs ;
332
+ verboseSs << " Status line " << line;
333
+ log (verboseSs .str (), args);
334
334
}
335
335
336
336
if (sscanf (line.c_str (), " HTTP/1.1 %d" , &code) != 1 )
337
337
{
338
- std::string errorMsg (" Cannot parse response code from status line" );
338
+ std::string msg (" Cannot parse response code from status line" );
339
339
return std::make_shared<HttpResponse>(code,
340
340
description,
341
341
HttpErrorCode::MissingStatus,
342
342
headers,
343
343
payload,
344
- errorMsg ,
344
+ msg ,
345
345
uploadSize,
346
346
downloadSize);
347
347
}
@@ -353,13 +353,13 @@ namespace ix
353
353
if (!headersValid)
354
354
{
355
355
auto errorCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::HeaderParsingError;
356
- std::string errorMsg (" Cannot parse http headers" );
356
+ std::string msg (" Cannot parse http headers" );
357
357
return std::make_shared<HttpResponse>(code,
358
358
description,
359
359
errorCode,
360
360
headers,
361
361
payload,
362
- errorMsg ,
362
+ msg ,
363
363
uploadSize,
364
364
downloadSize);
365
365
}
@@ -369,27 +369,27 @@ namespace ix
369
369
{
370
370
if (headers.find (" Location" ) == headers.end ())
371
371
{
372
- std::string errorMsg (" Missing location header for redirect" );
372
+ std::string msg (" Missing location header for redirect" );
373
373
return std::make_shared<HttpResponse>(code,
374
374
description,
375
375
HttpErrorCode::MissingLocation,
376
376
headers,
377
377
payload,
378
- errorMsg ,
378
+ msg ,
379
379
uploadSize,
380
380
downloadSize);
381
381
}
382
382
383
383
if (redirects >= args->maxRedirects )
384
384
{
385
- std::stringstream ss ;
386
- ss << " Too many redirects: " << redirects;
385
+ std::stringstream maxRedirectSs ;
386
+ maxRedirectSs << " Too many redirects: " << redirects;
387
387
return std::make_shared<HttpResponse>(code,
388
388
description,
389
389
HttpErrorCode::TooManyRedirects,
390
390
headers,
391
391
payload,
392
- ss .str (),
392
+ maxRedirectSs .str (),
393
393
uploadSize,
394
394
downloadSize);
395
395
}
@@ -446,7 +446,7 @@ namespace ix
446
446
else if (headers.find (" Transfer-Encoding" ) != headers.end () &&
447
447
headers[" Transfer-Encoding" ] == " chunked" )
448
448
{
449
- std::stringstream ss ;
449
+ std::stringstream chunkSizeSs ;
450
450
451
451
while (true )
452
452
{
@@ -467,9 +467,9 @@ namespace ix
467
467
}
468
468
469
469
uint64_t chunkSize;
470
- ss .str (" " );
471
- ss << std::hex << line;
472
- ss >> chunkSize;
470
+ chunkSizeSs .str (" " );
471
+ chunkSizeSs << std::hex << line;
472
+ chunkSizeSs >> chunkSize;
473
473
474
474
if (args->verbose )
475
475
{
@@ -485,11 +485,11 @@ namespace ix
485
485
isCancellationRequested);
486
486
if (!chunkResult.first )
487
487
{
488
- auto errorCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::ChunkReadError;
488
+ auto errCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::ChunkReadError;
489
489
errorMsg = " Cannot read chunk" ;
490
490
return std::make_shared<HttpResponse>(code,
491
491
description,
492
- errorCode ,
492
+ errCode ,
493
493
headers,
494
494
payload,
495
495
errorMsg,
@@ -508,10 +508,10 @@ namespace ix
508
508
509
509
if (!lineResult.first )
510
510
{
511
- auto errorCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::ChunkReadError;
511
+ auto errCode = args->cancel ? HttpErrorCode::Cancelled : HttpErrorCode::ChunkReadError;
512
512
return std::make_shared<HttpResponse>(code,
513
513
description,
514
- errorCode ,
514
+ errCode ,
515
515
headers,
516
516
payload,
517
517
errorMsg,
@@ -528,13 +528,13 @@ namespace ix
528
528
}
529
529
else
530
530
{
531
- std::string errorMsg (" Cannot read http body" );
531
+ std::string msg (" Cannot read http body" );
532
532
return std::make_shared<HttpResponse>(code,
533
533
description,
534
534
HttpErrorCode::CannotReadBody,
535
535
headers,
536
536
payload,
537
- errorMsg ,
537
+ msg ,
538
538
uploadSize,
539
539
downloadSize);
540
540
}
@@ -548,25 +548,25 @@ namespace ix
548
548
std::string decompressedPayload;
549
549
if (!gzipDecompress (payload, decompressedPayload))
550
550
{
551
- std::string errorMsg (" Error decompressing payload" );
551
+ std::string msg (" Error decompressing payload" );
552
552
return std::make_shared<HttpResponse>(code,
553
553
description,
554
554
HttpErrorCode::Gzip,
555
555
headers,
556
556
payload,
557
- errorMsg ,
557
+ msg ,
558
558
uploadSize,
559
559
downloadSize);
560
560
}
561
561
payload = decompressedPayload;
562
562
#else
563
- std::string errorMsg (" ixwebsocket was not compiled with gzip support on" );
563
+ std::string msg (" ixwebsocket was not compiled with gzip support on" );
564
564
return std::make_shared<HttpResponse>(code,
565
565
description,
566
566
HttpErrorCode::Gzip,
567
567
headers,
568
568
payload,
569
- errorMsg ,
569
+ msg ,
570
570
uploadSize,
571
571
downloadSize);
572
572
#endif
0 commit comments