Changeset 56 in cheroxy


Ignore:
Timestamp:
12/13/12 18:26:44 (7 years ago)
Author:
cheese
Message:

#1 fix to return from CRXProxy::ReceiveResponse if receive zero-byte(infinite-loop bug).

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/CRXProxy.cpp

    r46 r56  
    160160            CRX_ERROR_SET (aResult, "Failed to receive from server.");
    161161            return aResult;
     162        }
     163        else if (aResult == 0)
     164        {
     165            CRX_ADD_SUBCLASS_ERROR (mServer);
     166            CRX_ERROR_SET (aResult, "Receive zero-byte from server.");
     167            break;
    162168        }
    163169
  • trunk/src/main.cpp

    r55 r56  
    147147                                  aFilterFileExtension);
    148148
     149        /* 1. receive request from client */
    149150        aResult = aProxy->ReceiveRequest ();
    150151        if (aResult < 0)
     
    153154        }
    154155
     156        /* 1.1. modify and print request data */
    155157        if (gViewRequest && !aFilter.CheckRequestFilter (CRX_FILTER_REQUEST_FILE_EXTENSION, aRequest))
    156158        {
     
    162164        }
    163165
     166        /* 2. send request to web server */
    164167        aResult = aProxy->SendRequest ();
    165168        if (aResult < 0)
     
    168171        }
    169172
     173        /* 3. receive response from web server */
    170174        aResult = aProxy->ReceiveResponse ();
    171175        if (aResult < 0)
     
    174178        }
    175179
     180        /* 3.1. if request url is matched, print response */
    176181        if (gViewResponse && !aFilter.CheckRequestFilter (CRX_FILTER_REQUEST_FILE_EXTENSION, aRequest))
    177182        {
     
    182187        }
    183188
     189        /* 4. send response to client */
    184190        aResult = aProxy->SendResponse ();
    185191        if (aResult < 0)
Note: See TracChangeset for help on using the changeset viewer.