STiB Source


The name "STiB" stands for something, but we're not quite sure what. It could be "Slow Transfer is Benign", "STiB Terminology is Backwards", or "Sipping Tea in Belgium", or it could just be "BITS" spelled backwards with a small 'i'.

BITS is an MS Windows file transfer service. It is the service used to download Windows Update patches and service packs. Its main feature is that it handles transfers in the background so that it can (in theory) avoid interfering with other tasks.

BITS supports both download and upload file transfers. Downloads are performed using standard HTTP (or HTTPS), but uploads are performed using a set of proprietary extensions to HTTP.

STiB implements the BITS upload protocol (currently, only the client side). The key components of the project, at present, are:

stibtest:
This is a testing program used to exercise the STiB client library (see stibclilib, below). It can send a BITS Ping command to a server, send a file to the server using the BITS upload protocol, or start a BITS upload session under user control.

The latter is probably the most interesting from a testing perspective. Entering a command in the following format:

  $ stibtest sess sourcefile.ext http://server/path/name.ext
...will cause stibtest to attempt to create a TCP connection with the server and send the initial Create Session request to establish the BITS session.

New in V0.2:
Added support for a simple GET command.

  $ stibtest get http://server/path/name.ext destinationfile.ext
  • Allows the user to enable Microsoft PeerDist encoding in the request.
  • Allows the user to specify a (single) range of bytes to be retrieved.
The stibtest get command stores the raw content returned by the server in the destination file.
stibclilib:
This is a library of functions that can be used to build a BITS client. There are individual functions for sending each of the five available BITS request messages. In addition, there are functions that allow the user to compose and send their own message, parse URL strings, and parse server response messages.

Known bug in V0.2:
At present, stibclilib does not handle chunked encoding properly. The planned solution is to revisit the entire mechanism used for reading the server's responses.

Gbfr:
Growable buffers. This module packages a mechanism for creating buffers that grow in size as needed, up to a hard-coded limit.
util:
A grab bag of useful functions.
ubi_sLinkList:
A simple singly linked list implementation.

To compile stibtest:

$ cc -o stibtest -lreadline     \
                  stibtest.c    \
                  stibclilib.c  \
                  Gbfr.c        \
                  util.c        \
                  ubi_sLinkList.c

GNU Readline is required by the interactive session mode of stibtest.


[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -
[TXT]ReadMe.STiB28-Jun-2011 03:14 3.1K
[   ]STiB01.tgz28-Jun-2011 03:09 42KTarred and gzipped.
[   ]STiB02.tgz28-Jun-2011 03:27 42KTarred and gzipped.
[DIR]src/28-Jun-2011 03:28 -

Apache/2.2.3 (CentOS) Server at ubiqx.org Port 80