[haiku-depot-web] Re: API getPkg()

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-depot-web@xxxxxxxxxxxxx
  • Date: Wed, 23 Apr 2014 00:07:45 +0200

Hi,

it seems I managed to get the server app into an "illegal state". I was stepping through the Debugger in HaikuDepot generating a getPkg request to trigger it. I did the following:

* Sending POST requests with a chunked transfer type (not actually intentional). The behavior was that the server eventually replied after a long time out that the request was not understood. * Tried to step through the Debugger with a non-SSL enabled build of libbnetapi, which failed to establish the connection and is thus probably irrelevant here. * Realized while stepping through the code that the Haiku BHttpRequest API allows to specify the size of the uploaded data. * Rebuild libbnetapi with SSL support and changed the code to specify the size. * Stepped through the request sending again, which adds delays while sending data through the socket. This time, the request was sent with a Content-Length header (length of the JSON string minus termination byte). * Getting to the point where libbnetapi tried to read the reply from the socket, it exited the method with an error immediately. * Then I ran the code outside the Debugger, now there is no delay in the server response, but I get this:

Response: 200: OK
{"jsonrpc":"2.0","id":4143431,"error":{"code":0,"message":null,"data":{"exceptionTypeName":"java.lang.IllegalStateException","message":null}}}

I get this only for the getPkg request, also from another computer with my Java test app. The new getBulkPkg request seems to be unaffected, when I run it from the Java app.

Best regards,
-Stephan


Other related posts: