OpenBSD CVS

CVS log for src/usr.sbin/smtpd/Attic/client.h


[BACK] Up to [local] / src / usr.sbin / smtpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.15, Sun Jan 29 11:37:32 2012 UTC (12 years, 4 months ago) by eric
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED

Rewrite io code in smtp and mta using the iobuf/ioev interface to have
a better separation between io and protocol logic.  As a side-effect,
it fixes a couple of long-standing issues in the io path, and
hopefully add fresh ones instead.  Kill client.c in the process.

ok gilles@

Revision 1.14 / (download) - annotate - [select for diffs], Sat Mar 26 10:59:59 2011 UTC (13 years, 2 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

have the client API receive a stdio stream rather than a fd to the message
fd. this shifts responsibility for the fclose to the caller, prevents a
memory leak and makes everyone happy.

diff by Jared Yanovich, thanks !

Revision 1.13 / (download) - annotate - [select for diffs], Sun Nov 28 13:56:43 2010 UTC (13 years, 6 months ago) by gilles
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.12: +22 -1 lines
Diff to previous 1.12 (colored)

a bit of .h cleanups, no functionnal change

Revision 1.12 / (download) - annotate - [select for diffs], Wed May 26 13:56:08 2010 UTC (14 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Rename some imsg bits to make namespace collisions less likely buf to
ibuf, buf_read to ibuf_read, READ_BUF_SIZE to IBUF_READ_SIZE.

ok henning gilles claudio jacekm deraadt

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jan 2 16:41:19 2010 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.10: +8 -5 lines
Diff to previous 1.10 (colored)

Replace 3 struct smtp_client members (ssl_handshake, rcptokay, dying) with a
bitmap called "flags".

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jan 2 13:42:42 2010 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.9: +5 -5 lines
Diff to previous 1.9 (colored)

Factor out parts of client_read() into client_socket_read() and
client_get_reply(), downsizing it from 170+ to just over 30 lines.
The gotos are now gone, too.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jan 2 11:06:37 2010 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.8: +1 -2 lines
Diff to previous 1.8 (colored)

Simplify code by removing struct smtp_client member, int iomode, which was
used for keeping track of the current polling mode.  Introduce new function
client_poll() that determines what mode of polling is required at the time of
call.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Dec 23 17:16:03 2009 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.7: +54 -46 lines
Diff to previous 1.7 (colored)

Implementation of RFC 2920 PIPELINING extension, client side only for now.

This restructures the client_* API internals significantly.  The code becomes
pipelining in nature.  All SMTP commands are put on the output queue and
dequeued as quickly as possible.  Once dequeued, they're moved to the receive
queue so that replies can be matched with previous commands.

Dequeuing commands from the output queue halts when the count of commands
currently in-pipeline (``cmdi'') is equal to the command send window (``cmdw'').
There are three cmdw values useful in practice:

0               clear pipeline, ie. inhibit all future sends
1               disable pipelining, ie. use old ``one-request-one-reply`` mode
SIZE_T_MAX      enable pipelining, ie. dequeue as many commands as possible

At the beginning of session cmdw is 1.  When it is found that peer supports
PIPELINING, it grows to SIZE_T_MAX.  After dequeing DATA it is again 1.  After
sending QUIT it is 0.

Each command dequeued from the output queue becomes a buf in a msgbuf.  The act
of combining multiple commands into a single send operation did not need to be
implemented: buf_write() already combines bufs using iovec and sends them at
once using sendmsg(2).

Tested by todd@ and oga@

"looks good" to gilles@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 15 11:45:51 2009 UTC (14 years, 5 months ago) by jacekm
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

Simplify SSL code client-side, no functional change.

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 12 14:03:59 2009 UTC (14 years, 6 months ago) by jacekm
Branch: MAIN
Changes since 1.5: +5 -5 lines
Diff to previous 1.5 (colored)

When acting as a client do content reads from the disk progressively
as the remote accepts more data instead of doing one big read into
the memory in the beginning of session.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Dec 12 10:33:11 2009 UTC (14 years, 6 months ago) by jacekm
Branch: MAIN
Changes since 1.4: +21 -25 lines
Diff to previous 1.4 (colored)

Simplify client_* api, mainly by making fatal conditions result in immediate
fatals instead of passing the error up (kills ~300 lines).

Implement sending of the QUIT command which replaces crude close(2).

tested by gilles@, todd@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Sep 22 12:24:06 2009 UTC (14 years, 8 months ago) by jacekm
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

When at MAIL FROM stage, handle the case when STARTTLS is required but not
available.  Also, make the client_next_state() calls across the code more
idiomatic.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Sep 15 16:50:06 2009 UTC (14 years, 8 months ago) by jacekm
Branch: MAIN
Changes since 1.2: +65 -17 lines
Diff to previous 1.2 (colored)

Extend SMTP client_* API to support SSL+AUTH, and use it in the mta
process to relay mails.  ok gilles@

Revision 1.2 / (download) - annotate - [select for diffs], Thu Aug 27 11:42:50 2009 UTC (14 years, 9 months ago) by jacekm
Branch: MAIN
Changes since 1.1: +2 -0 lines
Diff to previous 1.1 (colored)

$OpenBSD$

Revision 1.1 / (download) - annotate - [select for diffs], Thu Aug 27 11:41:26 2009 UTC (14 years, 9 months ago) by jacekm
Branch: MAIN

Implement client side of the SMTP protocol in a library-like module.
Make bounce code and /usr/sbin/sendmail interface use this new API.
The mta process continues to use its own implementation, but
eventually will be switched to use this shared module.

Buffer routines are taken from buffer.c rather than from evbuffer.
This is one step forward to using a single buffer API across the
program.

"it looks sexy" gilles@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.