<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,6 @@
 {application, ibrowse,
         [{description, &quot;HTTP client application&quot;},
-         {vsn, &quot;1.5.1&quot;},
+         {vsn, &quot;1.5.3&quot;},
          {modules, [ ibrowse, 
 		     ibrowse_http_client, 
 		     ibrowse_app, </diff>
      <filename>ebin/ibrowse.app</filename>
    </modified>
    <modified>
      <diff>@@ -413,15 +413,31 @@ handle_sock_closed(#state{reply_buffer = Buf, reqs = Reqs, http_status_code = SC
 	    State
     end.
 
-do_connect(Host, Port, _Options, #state{is_ssl=true, ssl_options=SSLOptions}, Timeout) -&gt;
+do_connect(Host, Port, Options, #state{is_ssl=true, ssl_options=SSLOptions}, Timeout) -&gt;
+    Caller_socket_options = get_value(socket_options, Options, []),
+    Other_sock_options = filter_sock_options(SSLOptions ++ Caller_socket_options),
     ssl:connect(Host, Port,
-		[binary, {nodelay, true}, {active, false} | SSLOptions],
+		[binary, {nodelay, true}, {active, false} | Other_sock_options],
 		Timeout);
-do_connect(Host, Port, _Options, _State, Timeout) -&gt;
+do_connect(Host, Port, Options, _State, Timeout) -&gt;
+    Caller_socket_options = get_value(socket_options, Options, []),
+    Other_sock_options = filter_sock_options(Caller_socket_options),
     gen_tcp:connect(Host, Port,
-		    [binary, {nodelay, true}, {active, false}],
+		    [binary, {nodelay, true}, {active, false} | Other_sock_options],
 		    Timeout).
 
+%% We don't want the caller to specify certain options
+filter_sock_options(Opts) -&gt;
+    lists:filter(fun({active, _}) -&gt;
+			 false;
+		    ({packet, _}) -&gt;
+			 false;
+		    (list) -&gt;
+			 false;
+		    (_) -&gt;
+			 true
+		 end, Opts).
+
 do_send(Req, #state{socket = Sock, is_ssl = true})  -&gt;  ssl:send(Sock, Req);
 do_send(Req, #state{socket = Sock, is_ssl = false}) -&gt;  gen_tcp:send(Sock, Req).
 </diff>
      <filename>src/ibrowse_http_client.erl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ce2cc0140e7fca5045331e868f04f15d4060eaa7</id>
    </parent>
  </parents>
  <author>
    <name>Chandrashekhar Mullaparthi</name>
    <email>chandrashekhar.mullaparthi@t-mobile.co.uk</email>
  </author>
  <url>http://github.com/dizzyd/ibrowse/commit/2e6bff7e8bc66a774e5beafe84eadb33cb93641f</url>
  <id>2e6bff7e8bc66a774e5beafe84eadb33cb93641f</id>
  <committed-date>2009-09-06T00:26:47-07:00</committed-date>
  <authored-date>2009-09-06T00:26:47-07:00</authored-date>
  <message>Allow socket options to be set by caller during the connect phase as well</message>
  <tree>81f5bf3f7c6ee261b6d1b56de721ea33d28bfc4d</tree>
  <committer>
    <name>Chandrashekhar Mullaparthi</name>
    <email>chandrashekhar.mullaparthi@t-mobile.co.uk</email>
  </committer>
</commit>
