Luca Franceschini
PhD days seminars, 12 October 2018
const http = require('http')
for (let i = 1; i <= 100; i++) {
const req = http.request('www.website.com', {method:'POST'})
req.write(String(i))
req.end()
}
const http = require('http')
for (let i = 1; i <= 100; i++) {
const req = http.request('www.website.com', {method:'POST'})
req.write(String(i))
req.end()
}
const http = require('http')
function request(i) {
if (i <= MAX) {
const req = http.request('www.website.com', {method:'POST'})
req.write(String(i))
req.end(() => request(i+1))
}
}
request(1)
function verifyUser(username, password, callback) {
dataBase.verifyUser(username, password, (error, userInfo) => {
if (error) {
callback(error)
} else {
dataBase.getRoles(username, (error, roles) => {
if (error) {
callback(error)
} else {
dataBase.logAccess(username, (error) => {
if (error) {
callback(error)
} else {
callback(null, userInfo, roles)
}
})
}
})
}
})
}
const http = require('http')
const server = http.createServer((req, res) => {
res.write('okay')
// res.end() call missing
})
server.listen(80);
This method signals to the server that all of the response headers and body have been sent; that server should consider this message complete. The method, response.end(), MUST be called on each response.
Trace expressions!
const http = require('http')
const server = http.createServer((req, res) => {
res.write('okay')
// res.end() call missing
})
server.listen(80);
Prolog!
T = var(idCb, (create(var(id)) : Tcb))
Jalangi!
We intercept by code instrumentation all
LAST YEAR PROGRESS
Last submitted paper includes 12 examples
Express code is not trivial:
Make specifications reusable
Declare
Use
From a few RPS to hundreds!
Experiments are now available and reproducible:
Automatically generate Prolog code from specification
const obj = {
x: 42,
getX: function() {
return this.x;
}
}
const unboundGetX = module.getX;
console.log(unboundGetX()); // undefined
const boundGetX = unboundGetX.bind(obj);
console.log(boundGetX()); // 42
Automatically derive which functions needs to be monitored from the specification, and produce an appropriate filter
Currently a new HTTP connection for every observed event... not very efficient