Browse Source

Fixed coding style and improved comments. Fixed typo in error message.


git-svn-id: https://svn.microneil.com/svn/SNFMilter/trunk@11 2c985dca-31e6-41a4-b4a2-d8f5b7f8e074
master
adeniz 15 years ago
parent
commit
2d81e0f1d2
2 changed files with 10 additions and 5 deletions
  1. 5
    0
      ChangeLog
  2. 5
    5
      SNFMilter.cpp

+ 5
- 0
ChangeLog View File

2009-06-18 Alban Deniz <adeniz@skidmark.localdomain>

* SNFMilter.cpp (getContextFromCtx): Fixed coding style, added
comment.

2009-06-06 Alban Deniz <adeniz@skidmark.localdomain> 2009-06-06 Alban Deniz <adeniz@skidmark.localdomain>


* Makefile.am: Install/uninstall SNFDebugMilter link to SNFMilter. * Makefile.am: Install/uninstall SNFDebugMilter link to SNFMilter.

+ 5
- 5
SNFMilter.cpp View File

// //
// \throws runtime_error if the obtained pointer is 0. // \throws runtime_error if the obtained pointer is 0.
// //
SNFMilterContext *
SNFMilterContext*
getContextFromCtx(SMFICTX* Ctx) { getContextFromCtx(SMFICTX* Ctx) {
SNFMilterContext* Context = (SNFMilterContext*) smfi_getpriv(Ctx);
if(0 == Context) throw runtime_error("Got NULL from snfi_getpriv()");
SNFMilterContext* Context = (SNFMilterContext*) smfi_getpriv(Ctx); // Get the context object.
if(0 == Context) throw runtime_error("Got NULL from smfi_getpriv()");
return Context; return Context;
} }
// //
// \throws runtime_error if the obtained pointer is 0. // \throws runtime_error if the obtained pointer is 0.
// //
SNFMilterContext *
SNFMilterContext*
assignContextToCtx(SMFICTX* Ctx) { assignContextToCtx(SMFICTX* Ctx) {
SNFMilterContext *Context = MilterContexts->grab(); // Get any existing context object.
SNFMilterContext* Context = MilterContexts->grab(); // Get any existing context object.
if(0 == Context) // Check address. if(0 == Context) // Check address.
throw runtime_error("Got NULL from MilterContexts->grab()"); throw runtime_error("Got NULL from MilterContexts->grab()");
smfi_setpriv(Ctx, Context); // Save the context object. smfi_setpriv(Ctx, Context); // Save the context object.

Loading…
Cancel
Save