~ubuntu-branches/ubuntu/intrepid/gnunet/intrepid

« back to all changes in this revision

Viewing changes to src/server/handler.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-08-19 19:44:30 UTC
  • mfrom: (1.2.12 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080819194430-x5gjv8wd7t7ldkp0
Tags: 0.8.0a-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #256576)
  - debian/rules:
   + Make use of code from cdbs' clean-la.mk file to clear the
      dependency_libs field in all .la files in the gnunet-dev 
      package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
383
383
  return ret;
384
384
}
385
385
 
 
386
#if HAVE_UNALIGNED_64_ACCESS
 
387
#define ALIGN_REQUIRED sizeof(unsigned int)
 
388
#else
 
389
#define ALIGN_REQUIRED sizeof(unsigned long long)
 
390
#endif
386
391
 
387
392
/**
388
393
 * Handle a message (that was decrypted if needed).
443
448
            }
444
449
          return;
445
450
        }
446
 
      if ((pos % sizeof (long)) != 0)
447
 
        {
 
451
 
 
452
      if ((((long) &msg[pos]) & (ALIGN_REQUIRED-1)) != 0)
 
453
        {
448
454
          /* correct misalignment; we allow messages to _not_ be a
449
 
             multiple of sizeof(long) bytes (if absolutely necessary; it should be
 
455
             multiple of 4-bytes (if absolutely necessary; it should be
450
456
             avoided where the cost for doing so is not prohibitive);
451
457
             however we also (need to) guaranteed word-alignment for the
452
458
             handlers; so we must re-align the message if it is
457
463
        }
458
464
      else
459
465
        {
460
 
          part = (const GNUNET_MessageHeader *) &msg[pos];
461
 
        }
 
466
          part = (const GNUNET_MessageHeader *) &msg[pos];        
 
467
        }
462
468
      pos += plen;
463
469
 
464
470
      ptyp = htons (part->type);