GSoC 2014 Friday Report #8

Todo For This Week

  • Rewrite USB and TCP to not need knowledge of message size
  • Book flight and hotel for OpenPrinting Summit

Completed This Week

  • Flight and hotel booked
  • USB and TCP no longer depend on message size
  • Removed then unused message size finding code
  • Discovered printer did not support HTTPS after all
  • Added usb interface pool
  • Spawned thread for every tcp connections, which grabs a usb interface

Todo Next Week

  • Add back the size finding code
  • Release usb interface when we know a complete message has left the printer
  • Fill out Google Summer of Code mid-term evaluation

This week brought a new and more fundamental limitation ippusbxd must surmount. When a web browser opens a webpage it wants to open multiple HTTP connections and reduce page load times. Many years ago this meant using 2 connections. Now browsers open 6!

In addition these 6 connections are kept open and persistent. If a ipp over usb driver allocates one usb interface per tcp connection the web page will not load. Part of the page may load if the files have been requested over a lucky connection. The unlucky connections will hang and never get responses.

Early in the week I was working under the assumption the printer needed HTTPS. Once that code was working I learned this was wrong. The printer does not even support HTTPS. The “please use HTTPS” message on the webpage was a sporadic bug caused by lost resources.

Instead handling 6 TCP connections with only 2 or more real connections is our fundamental challenge which stumped me this week.

The solution I found was to support both encrypted HTTP, and read-able HTTP. When handling encrypted HTTP we’ll default to a ratio of one real connection to one TCP connection. Read-able HTTP is the nice case where we can know when a real connection will be unused. This lets us release the real connection, the usb interface, back to the interface pool. Then new requests over the TCP connection cause us to pull an interface out of the pool.

By releasing the interface after every HTTP message we will cycle through the TCP connections. Thus no TCP connection will stale.

Anyway ippusbxd is where I hope we would be for the mid-term. Provided clients do not exhaust the usb interfaces ippusbxd will bring up the printer’s webpage without issue!

2014-06-17-222055_3600x1080_scrot

The second half of GSoC will be less focused on ippusbxd. Instead my todo list consists of:

  • Finish the new pwg website
  • Write and practice the ippusbxd presentation
  • Make udev-configure-printer start ippusbxd
  • Make udev-configure-printer configure the CUPS queue
  • Make CUPS match ipp over usb printers between restarts, best to ask msweet about this

 

Leave a Reply

Your email address will not be published.