Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pcap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ var util, IOWatcher,
dns = require('dns'),
Buffer = require('buffer').Buffer,
events = require('events'),
binding = require('./build/default/pcap_binding'),
HTTPParser = process.binding('http_parser').HTTPParser,
url = require('url');

/*
* Try catch here around multiple build paths to support
* `node@0.4.x` and >= `node@0.5.x`.
*/
try {
binding = require('./build/default/pcap_binding');
}
catch (ex) {
binding = require('./build/Release/pcap_binding');
}

if (process.versions && process.versions.node && process.versions.node.split('.')[1] >= 3) {
util = require("util");
IOWatcher = process.binding('io_watcher').IOWatcher;
Expand Down
2 changes: 0 additions & 2 deletions pcap_binding.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <node.h>
#include <node_events.h>
#include <node_buffer.h>
#include <node_version.h>
#include <assert.h>
Expand All @@ -9,7 +8,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ev.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
Expand Down