• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Serf Error Codes

    October 21st, 2015
    pagespeed, tech  [html]
    PageSpeed uses serf to fetch things over http. Sometimes serf gives errors back to PageSpeed that get reported in error messages:
      Serf status 120171(APR does not understand this error code)
    
    The serf documentation is limited, however, so it's hard to look these up. So here's a reference, from serf.h in serf 1.3.8:

    code meaning
    120101 This code is for when this is the last response on this connection: i.e. do not send any more requests on this connection or expect any more responses.
    120102 This code is for when the connection terminated before the request could be processed on the other side.
    120103 This code is for when the connection is blocked—we can not proceed until something happens - generally due to SSL negotiation-like behavior where a write() is blocked until a read() is processed.
    120104 This code is for when something went wrong during deflating compressed data e.g. a CRC error.
    120105 This code is for when a response received from a http server is not in http-compliant syntax.
    120106 The server sent less data than what was announced.
    120107 The proxy server returned an error while setting up the SSL tunnel.
    120108 The server unexpectedly closed the connection prematurely.
    120170 SSL certificates related errors.
    120171 SSL communications related errors.
    120190 General authentication related errors.
    120191 None of the available authentication mechanisms for the request are supported.
    120192 Authentication was requested by the server but the header lacked some attribute.
    120193 Authentication handler initialization related errors.
    120199 Error code reserved for use in the test suite.

    Why are these hard to look up in the code? They're all defined with macros:

      #define SERF_ERROR_RANGE 100
      #define SERF_ERROR_START \
        (APR_OS_START_USERERR + \
         SERF_ERROR_RANGE)
    
      #define SERF_ERROR_CLOSING \
        (SERF_ERROR_START + 1)
      #define SERF_ERROR_REQUEST_LOST \
        (SERF_ERROR_START + 2)
      ...
    
    This means that a search for [120108] or something won't turn anything up, which is annoying. This also means that on some platforms serf error codes can have a different prefix. In PageSpeed, though, this is all determined at compile time because it includes its dependencies, so it should be the same everywhere.

    Comment via: google plus

    Recent posts on blogs I like:

    Who Should Bear the Risk in Infrastructure Projects?

    The answer to the question is the public sector, always. It’s okay to have private-sector involvement in construction, but the risk must be borne by the public sector, or else the private sector will just want more money to compensate for the extra risk. …

    via Pedestrian Observations November 30, 2020

    Fireside Friday, November 27, 2020

    Hey folks! Fireside this week. A bit of a change-up in terms of the coming attractions. I had planned to start “Textiles, How Did They Make It?” next, but I want to do a bit more reading on some of the initial stages of textile production (that is, the pr…

    via A Collection of Unmitigated Pedantry November 27, 2020

    Thoughts you mightn't have thunk about remote meetings

    Welcome to this week's edition of "building a startup in 2020," in which all your meetings are suddenly remote, and you probably weren't prepared for it. I know I wasn't. We started a "fully remote" company back in 2019, but …

    via apenwarr November 23, 2020

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact