Initialize the socket bucket (conn->stream) to NULL. This in order to avoid
a crash while cleaning up a connection for which the socket bucket wasn't 
created.

* context.c
  (serf_connection_create): initialize conn->stream to NULL


git-svn-id: http://serf.googlecode.com/svn/trunk@1125 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
* serf_get.c: cleanup whitespace.


git-svn-id: http://serf.googlecode.com/svn/trunk@1126 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Fix compilation warnings from GCC 4.1.1.  Two compilation warnings
remain:

buckets/ssl_buckets.c: In function 'serf_ssl_client_cert_provider_set':
buckets/ssl_buckets.c:765: warning: dereferencing type-punned pointer will break strict-aliasing rules
buckets/ssl_buckets.c: In function 'serf_ssl_client_cert_password_set':
buckets/ssl_buckets.c:780: warning: dereferencing type-punned pointer will break strict-aliasing rules


* buckets/ssl_buckets.c
  (bio_file_read): Remove unused local variable "data".

* test/serf_response.c
  (main): Make initialization of fields in local variable "accept_ctx"
   obvious to the compiler (it also occurs in accept_response()).


git-svn-id: http://serf.googlecode.com/svn/trunk@1127 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Initial implementation of test framework.

* serf.mak (): Build test_all.exe.
* test/CuTest.c
* test/CuTest.h: The CuTest framework version 1.4, no
  modifications have been made
* test/test_all.c
  (test_list): List of test suites.
  (main): Run specified test suites or just list them. 
* test/test_serf.h: General declaration.
* test/test_util.c
  (default_closed_connection, default_conn_setup,
  get_server_address, replay, next_action,
  test_server_create, test_server_run,
  test_server_destroy): Initial implementation of test server
   which replays series of actions on connection.

* test/test_context.c
  (accept_response, handle_response, setup_request): Default
   serf request handlers.
  (test_serf_connection_create): Test that requests are sent and completed
   in order of creation.
  (test_context): Add test to list. 

Patch by: lieven.govaerts, me

git-svn-id: http://serf.googlecode.com/svn/trunk@1128 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
* serf.mak: Use macros to make it simpler.


git-svn-id: http://serf.googlecode.com/svn/trunk@1129 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Implement readline for simple buckets.

* serf.mak (TEST_OBJS): Compile and link test_buckets.c.
* buckets/simple_buckets.c
  (serf_simple_readline): Implement using serf_util_readline() helper.
* test/test_all.c
  (testlist): Add test_buckets test suite.
* test/test_buckets.c
  (test_simple_bucket): New test.
  (test_buckets): Define test_buckets test suite.
* test/test_serf.h
  (test_buckets): Declare test_buckets.

git-svn-id: http://serf.googlecode.com/svn/trunk@1130 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
* trunk: Add the tsvn:logwidthmarker property which is used by TortoiseSVN
  to show a marker in the commit dialog at width 78.


git-svn-id: http://serf.googlecode.com/svn/trunk@1131 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Provide default implementation of read_iovec and read_for_sendfile callbacks
for deflate and response buckets. We don't need them for present, but it's
better to fix it to avoid problems in future.

* buckets/deflate_buckets.c
* buckets/response_buckets.c
  (serf_bucket_type_deflate, serf_bucket_type_response): Use
   serf_default_read_iovec and serf_default_read_for_sendfile instead of NULL.


git-svn-id: http://serf.googlecode.com/svn/trunk@1132 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
* test/test_buckets.c
* test/test_context.c
* test/test_serf.h
* test/test_util.c: cleanup trailing whitespace

git-svn-id: http://serf.googlecode.com/svn/trunk@1133 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
In CuAssert*Equals, the expected value is always the second parameter, the 
actual value comes as third parameter.

* test/test_buckets.c
  (test_simple_bucket): swap expected and actual values in CuAssert*Equals 
   calls.


git-svn-id: http://serf.googlecode.com/svn/trunk@1134 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Make test name more explicit, these are unit tests after all, so we're not 
going to add more testcases in the same function.

* test/test_buckets.c
  (test_simple_bucket): renamed test function to ...
  (test_simple_bucket_readline): ... this.
  (test_buckets): use renamed test.


git-svn-id: http://serf.googlecode.com/svn/trunk@1135 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Add a new function that enables adding new requests at the beginning of the
request queue - but after all already written requests. This can be used to 
retry failed-due-to-authentication requests in-order.

* context.c
  (serf_connection_priority_request_create): new function

* serf.h
  (serf_connection_priority_request_create): new declaration

* test/test_context.c
  (test_serf_connection_priority_request_create): new test, tests that 
   priority requests are sent before the other requests.
  (test_context): run the new test

* test/test_serf.h
  (CHUNCKED_REQUEST, CHUNKED_RESPONSE, 
   CHUNKED_EMPTY_RESPONSE): new macro's to ease test writing.


git-svn-id: http://serf.googlecode.com/svn/trunk@1136 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Add a new test for the handling connections marked as 'close' by the server.

* test/test_context.c
  (test_serf_closed_connection): add new test.
  (test_context): run the new test.


git-svn-id: http://serf.googlecode.com/svn/trunk@1137 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Fix a compiler warning.

* test/serf_get.c
  (print_usage): Add "static" declaration.


git-svn-id: http://serf.googlecode.com/svn/trunk@1138 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Simple tests for response bucket.

* test/test_buckets.c
  (read_and_check_bucket): Helper for reading and checking buckets.
  (test_response_bucket_read): New test for HTTP/1.0 response.
  (test_response_bucket_chunked_read): New test for chunked HTTP/1.1 response.
  (test_buckets): Add new tests.


git-svn-id: http://serf.googlecode.com/svn/trunk@1139 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Follow-up to r1137.

* test/test_context.c
  (test_serf_closed_connection): Remove unused variable child_pool. Remove
  unneccessary "\" character in string literals.


git-svn-id: http://serf.googlecode.com/svn/trunk@1140 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
* test/test_context.c: Add TODO



git-svn-id: http://serf.googlecode.com/svn/trunk@1141 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Fix compile errors and warnings in the test suite on Linux.

* test/test_context.c
  (handler_baton_t): changed type of 'done' from BOOL to int.

* test/test_util.c
  (global): include stdlib.h for abort() call
  (prepare_server): add missing parameter in apr_socket_create call.


git-svn-id: http://serf.googlecode.com/svn/trunk@1142 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Make serfmake build and run the new test suite correctly on Linux.

* serfmake
  (global): add dependencies and header files for the new tests.
  (cmd_check): build and run the new tests, not only serf_response.
  (cmd_clean): cleanup artefacts of the new tests.
  (load_deps): handle the special case where test_all needs extra dependencies
   and header files.



git-svn-id: http://serf.googlecode.com/svn/trunk@1143 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Fix build warning.

* test/test_all.c
  (global): include stdlib.h for its exit() and atexit() declarations.



git-svn-id: http://serf.googlecode.com/svn/trunk@1144 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845